

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
    <meta name="description" content="若发现文章有误，敬请指教，感谢@[TOC]  运行环境  Vmware 15 JDK8 Flume1.9 CentOS7 操作系统  一、准备 netcat 工具 参考资料  Netcat 是一款简单的Unix工具，使用UDP和TCP协议。 它是一个可靠的容易被其他程序所启用的后台操作工具，同时它也被用作网络的测试工具或黑客工具。 使用它你可以轻易的建立任何连接。内建有很多实用的工具。  在Ce">
<meta property="og:type" content="article">
<meta property="og:title" content="Flume 笔记1 使用Flume收集netcat端口通信的信息到本地文件">
<meta property="og:url" content="http://example.com/2022/03/19/Flume%20%E7%AC%94%E8%AE%B01%20%E4%BD%BF%E7%94%A8Flume%E6%94%B6%E9%9B%86netcat%E7%AB%AF%E5%8F%A3%E9%80%9A%E4%BF%A1%E7%9A%84%E4%BF%A1%E6%81%AF%E5%88%B0%E6%9C%AC%E5%9C%B0%E6%96%87%E4%BB%B6/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="若发现文章有误，敬请指教，感谢@[TOC]  运行环境  Vmware 15 JDK8 Flume1.9 CentOS7 操作系统  一、准备 netcat 工具 参考资料  Netcat 是一款简单的Unix工具，使用UDP和TCP协议。 它是一个可靠的容易被其他程序所启用的后台操作工具，同时它也被用作网络的测试工具或黑客工具。 使用它你可以轻易的建立任何连接。内建有很多实用的工具。  在Ce">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/47f2d030beac4b5a84c2d93e7a2e4840.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/1f6d3ad810c44a16bd4739505e4df3f6.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/e587d3b775434721b6a67f16fc3e5af1.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/6e2c3377fde8449c851273f4a496d9f1.png">
<meta property="article:published_time" content="2022-03-19T12:44:44.000Z">
<meta property="article:modified_time" content="2022-08-22T15:43:16.927Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="Flume">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/47f2d030beac4b5a84c2d93e7a2e4840.png">
  
  
  
  <title>Flume 笔记1 使用Flume收集netcat端口通信的信息到本地文件 - Hexo</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>尤 Ni&#39;s Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="Flume 笔记1 使用Flume收集netcat端口通信的信息到本地文件"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        John Doe
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-03-19 20:44" pubdate>
          2022年3月19日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.5k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          21 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Flume 笔记1 使用Flume收集netcat端口通信的信息到本地文件</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：1 小时前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <blockquote>
<p>若发现文章有误，敬请指教，感谢<br>@[TOC]</p>
</blockquote>
<h1 id="运行环境"><a href="#运行环境" class="headerlink" title="运行环境"></a>运行环境</h1><hr>
<ul>
<li>Vmware 15</li>
<li>JDK8</li>
<li>Flume1.9</li>
<li>CentOS7 操作系统</li>
</ul>
<h1 id="一、准备-netcat-工具"><a href="#一、准备-netcat-工具" class="headerlink" title="一、准备 netcat 工具"></a>一、准备 netcat 工具</h1><hr>
<p><a target="_blank" rel="noopener" href="https://www.oschina.net/p/netcat?hmsr=aladdin1e1">参考资料</a></p>
<blockquote>
<p>Netcat 是一款简单的Unix工具，使用UDP和TCP协议。 它是一个可靠的容易被其他程序所启用的后台操作工具，同时它也被用作网络的测试工具或黑客工具。 使用它你可以轻易的建立任何连接。内建有很多实用的工具。</p>
</blockquote>
<p><strong>在CentOS7系统中安装netcat</strong></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">yum install -y nc<br></code></pre></td></tr></table></figure>

<p><strong>测试 netcat</strong></p>
<p>打开两个终端，第一个用于向9999端口发送消息，开启后终端会卡住，表示进入了等待输入消息的状态。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">nc -lk 9999</span><br></code></pre></td></tr></table></figure>

<p>第二个用于接收9999端口收到的消息</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">nc localhost 9999</span><br></code></pre></td></tr></table></figure>

<p>开始发送消息</p>
<p>![在这里插入图片描述](<a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/f3fef4ed2c344b2094ab05c674863c19.png#">https://img-blog.csdnimg.cn/f3fef4ed2c344b2094ab05c674863c19.png#</a> &#x3D;50%x)</p>
<p>另一端接收到消息<br>![在这里插入图片描述](<a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/d24b652f45bd448d9c47919a3e11932a.png#">https://img-blog.csdnimg.cn/d24b652f45bd448d9c47919a3e11932a.png#</a> &#x3D;50%x)<br>注：此时是可以双向通信的</p>
<p>测试完毕后Ctrl + Z 即可退出</p>
<h1 id="二、认识-Flume"><a href="#二、认识-Flume" class="headerlink" title="二、认识 Flume"></a>二、认识 Flume</h1><hr>
<h2 id="2-1-Flume-概念"><a href="#2-1-Flume-概念" class="headerlink" title="2.1 Flume 概念"></a>2.1 Flume 概念</h2><p><a target="_blank" rel="noopener" href="https://flume.apache.org/index.html">Flume官网</a></p>
<blockquote>
<p>Flume是一种分布式、可靠且可用的服务，用于高效地收集、聚合和移动大量日志数据。它有一个基于流数据流的简单灵活的体系结构。它具有可调的可靠性机制和许多故障切换和恢复机制，具有健壮性和容错性。它使用一个简单的可扩展数据模型，允许在线分析应用程序。</p>
</blockquote>
<p>简单来说，Flume可以用来收集海量日志信息，它同时支持将数据收集到HDFS、本地文件、HBase等多个存储框架，适合流式数据处理。</p>
<h2 id="2-1-Flume-架构"><a href="#2-1-Flume-架构" class="headerlink" title="2.1 Flume 架构"></a>2.1 Flume 架构</h2><p><img src="https://img-blog.csdnimg.cn/47f2d030beac4b5a84c2d93e7a2e4840.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<ul>
<li>Source 数据来源，支持多种框架，比如Avro、Netcat、、Kafka、JMS等</li>
<li>Channel 数据缓冲区，支持多种框架，比如JDBC、Kafka、Pseudo等</li>
<li>Sink 数据集成，同样支持多种框架，HDFS、Hive、Kafka、HBase等</li>
<li>Agent 前三者的统称 ，启动flume时通常都要加上agent字样。</li>
</ul>
<p>学习 Flume 可通过官方使用文档，十分详细而且有许多案例 <a target="_blank" rel="noopener" href="https://flume.apache.org/releases/content/1.9.0/FlumeUserGuide.html">Flume官方使用手册</a></p>
<p>以上大部分内容都来自官方文档，笔者认为若想学会使用一个框架或者工具，最好的办法是先耐心看看官方文档的说明，其实官方文档一般都会有很详细的讲解。<br><img src="https://img-blog.csdnimg.cn/1f6d3ad810c44a16bd4739505e4df3f6.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h1 id="三、使用-Flume-收集端口的信息"><a href="#三、使用-Flume-收集端口的信息" class="headerlink" title="三、使用 Flume 收集端口的信息"></a>三、使用 Flume 收集端口的信息</h1><hr>
<h2 id="3-1-开启netcat"><a href="#3-1-开启netcat" class="headerlink" title="3.1 开启netcat"></a>3.1 开启netcat</h2><p>找一个端口，例如：9999，首先检查端口号是否被占用</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">netstat  -anp  |grep 9999<br></code></pre></td></tr></table></figure>
<p>![在这里插入图片描述](<a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/830a118de05a4f88924a3693ee892030.png#">https://img-blog.csdnimg.cn/830a118de05a4f88924a3693ee892030.png#</a> &#x3D;60%x)<br>可以看到，由于之前测试未正常关闭，端口号9999正在被占用，那么接下来需要换一个端口号，比如12345</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">netstat  -anp  |grep 12345<br></code></pre></td></tr></table></figure>
<p>![在这里插入图片描述](<a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/6685024dd38744a2802a6e25188425cd.png#">https://img-blog.csdnimg.cn/6685024dd38744a2802a6e25188425cd.png#</a> &#x3D;60%x)<br>没有输出任何信息，则说明该端口号可用，接下来用这个端口进行测试。</p>
<h2 id="3-2-创建配置文件"><a href="#3-2-创建配置文件" class="headerlink" title="3.2 创建配置文件"></a>3.2 创建配置文件</h2><p>为方便之后的执行，该配置文件需要放在flume根目录的job（自己创建）的文件夹下，其他位置也行，后面命令相应变更即可。<br><code>port-flume-logger.conf</code></p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><code class="hljs ini"><span class="hljs-comment"># 声明agent</span><br><span class="hljs-attr">a1.sources</span> = r1<br><span class="hljs-attr">a1.sinks</span> = k1<br><span class="hljs-attr">a1.channels</span> = c1<br><br><span class="hljs-comment"># 定义数据来源，指定为netcat</span><br><span class="hljs-attr">a1.sources.r1.type</span> = netcat<br><span class="hljs-attr">a1.sources.r1.bind</span> = localhost<br><span class="hljs-attr">a1.sources.r1.port</span> = <span class="hljs-number">12345</span><br><br><span class="hljs-comment"># 定义sink类型，即输出源</span><br><span class="hljs-attr">a1.sinks.k1.type</span> = logger<br><br><span class="hljs-comment"># 定义缓冲管道 channel</span><br><span class="hljs-attr">a1.channels.c1.type</span> = memory<br><span class="hljs-attr">a1.channels.c1.capacity</span> = <span class="hljs-number">1000</span><br><span class="hljs-attr">a1.channels.c1.transactionCapacity</span> = <span class="hljs-number">100</span><br><br><span class="hljs-comment"># 将sink和channel绑定起来</span><br><span class="hljs-attr">a1.sources.r1.channels</span> = c1<br><span class="hljs-attr">a1.sinks.k1.channel</span> = c1<br></code></pre></td></tr></table></figure>

<h2 id="3-3-启动flume"><a href="#3-3-启动flume" class="headerlink" title="3.3 启动flume"></a>3.3 启动flume</h2><p><a target="_blank" rel="noopener" href="https://flume.apache.org/releases/content/1.9.0/FlumeUserGuide.html#starting-an-agent">参考地址</a></p>
<blockquote>
<p>官方模板<br>启动Flume的方式一：（常用）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">&gt;</span><span class="language-bash">$ bin/flume-ng agent -n <span class="hljs-variable">$agent_name</span> -c conf -f conf/flume-conf.properties.template</span><br></code></pre></td></tr></table></figure>
<p>启动Flume的方式二：（不常用）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">&gt;</span><span class="language-bash">$ bin/flume-ng agent --conf conf --conf-file example.conf --name a1 -Dflume.root.logger=INFO,console</span><br></code></pre></td></tr></table></figure>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">bin/flume-ng agent -n a1 -c conf/ -f job/port-flume-logger.conf -Dflume.root.logger=INFO,console<br></code></pre></td></tr></table></figure>
<p>开启后</p>
<p>![在这里插入图片描述](<a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/096260a4c3614a6c8e2b794bf48af405.png#">https://img-blog.csdnimg.cn/096260a4c3614a6c8e2b794bf48af405.png#</a> &#x3D;60%x)<br>终端处于监听状态，此时正在监听12345端口号，该命令等同于之前的</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">nc -lk 12345</span><br></code></pre></td></tr></table></figure>
<p>相当于一个服务端</p>
<p>接下来可使用nc命令开启一个客户端，向12345端口号发送消息（需另外开一个终端）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">nc localhost 12345<br></code></pre></td></tr></table></figure>

<p>接下来进行消息发送的测试</p>
<ul>
<li>客户端发送消息给Flume<br><img src="https://img-blog.csdnimg.cn/e587d3b775434721b6a67f16fc3e5af1.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></li>
<li>Flume采集到消息并打印到控制台<br><img src="https://img-blog.csdnimg.cn/6e2c3377fde8449c851273f4a496d9f1.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>可以看到，Flume将收集的消息封装成了<code>Event</code>对象，其中包含<code>headers</code>和<code>body</code>两个部分，而信息的内容包含在<code>body</code>里。</li>
</ul>
<p>至此，Flume收集netcat端口信息测试完毕。</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/" class="category-chain-item">中间件</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/Flume/">#Flume</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>Flume 笔记1 使用Flume收集netcat端口通信的信息到本地文件</div>
      <div>http://example.com/2022/03/19/Flume 笔记1 使用Flume收集netcat端口通信的信息到本地文件/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>John Doe</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年3月19日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/03/20/Flume%20%E7%AC%94%E8%AE%B02%20Flume%E5%A4%8D%E5%88%B6%E5%A4%9A%E5%8F%91%E6%A1%88%E4%BE%8B%20_%20%E9%85%8D%E7%BD%AE%E5%A4%9A%E4%B8%AAChannel%E5%AF%B9%E4%BA%8E%E7%9B%B8%E5%AF%B9%E4%B8%8D%E5%90%8C%E7%9A%84%E5%8D%95%E4%B8%AASink%20_%20%E5%B0%86%E6%9C%AC%E5%9C%B0%E6%97%A5%E5%BF%97%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9%E9%87%87%E9%9B%86%E5%88%B0HDFS%E5%92%8C%E5%8F%A6%E4%B8%80%E4%B8%AA%E6%9C%AC%E5%9C%B0%E4%BD%8D%E7%BD%AE/" title="Flume 笔记2 Flume复制多发案例 _ 配置多个Channel对于相对不同的单个Sink _ 将本地日志文件内容采集到HDFS和另一个本地位置">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Flume 笔记2 Flume复制多发案例 _ 配置多个Channel对于相对不同的单个Sink _ 将本地日志文件内容采集到HDFS和另一个本地位置</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/03/07/Zookeeper%20%E7%AC%94%E8%AE%B01%20%20%E5%8D%95%E8%8A%82%E7%82%B9%E9%85%8D%E7%BD%AE/" title="Zookeeper 笔记1 单节点配置">
                        <span class="hidden-mobile">Zookeeper 笔记1 单节点配置</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
